#pragma once

#include "framework.h"
#include "sever.h"

class Service
{
public:
	static INT_PTR CALLBACK WndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

	VOID Init(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR Create(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR wm_socket_notify(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR idcancel(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

	INT_PTR fd_accept(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR fd_connect(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR fd_read(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR fd_write(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
	INT_PTR fd_close(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);


private:

	SOCKET m_listen_socket;
	struct sockaddr_in m_addr;
	char szIPAddr[32] = { "0.0.0.0" };
	HWND hEdit;
};

